<template>
  <div class="home">
    <ly-tab
      class="fix"
      v-model="selectedId"
      :items="items"
      :options="options"
      @change="handleChange"
    />
    <router-view></router-view>
  </div>
</template>

<script>

export default {
  name:'Home',
  data(){
    return{
      selectedId:0,
      items:[
        {label: '热门'},
        {label: '服饰'},
        {label: '鞋包'},
        {label: '母婴'},
        {label: '百货'},
        {label: '食品'},
        {label: '内衣'},
        {label: '男装'},
        {label: '电器'}
      ],
      options:{
        activeColor:'#e9232c' //设置选中的颜色
      },
      subRouteUrl:[
        '/home/hot',
        '/home/dress',
        '/home/box',
        '/home/mbaby',
        '/home/general',
        '/home/food',
        '/home/shirt',
        '/home/man',
        '/home/ele',
      ]
    }
  },
  methods:{
    handleChange(item,index){
      this.$router.replace(this.subRouteUrl[index]);
    }
  }
}
</script>

<style lang="stylus" scoped rel="stylesheet/stylus">
.home
  height 100%
  background : #f5f5f5
  .fix
    position fixed
    z-index 998
</style>
